package com.yehuo.app.controller;


import com.yehuo.app.entity.Wallet;
import com.yehuo.app.mapper.WalletMapper;
import com.yehuo.app.model.APP;
import com.yehuo.app.service.WalletService;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping({"/wallet"})
public class WalletController {
    @Resource
    private WalletMapper walletMapper;
    @Autowired
    private WalletService walletService;

    @RequestMapping({"/getUserWallet"})
    public APP<Wallet> getUserWallet(String userId) {
        return this.walletService.getUserWallet(userId);
    }

    @RequestMapping({"/addMoney"})
    public APP<Wallet> addMoney(String userId,String amount) {
        return this.walletService.addMoney(userId,amount);
    }

}